home *** CD-ROM | disk | FTP | other *** search
- /* Easy V6.0 07-09-1996 15:38:35 */
- /* Easy O
- If=horizontal
- LevelNumbers=yes
- LineNumbers=yes
- ScreenFont=Arial,,80,9220,-11,0,400,0,0,0,0,0,0,3,2,1,34,96,96
- PrinterFont=Arial,,80,17414,-34,0,400,0,0,0,0,0,0,3,2,1,34,300,300
- LastLevelId=27 */
- /* Easy ( 1 */
- import java.applet.*; // Don't forget these import statements!
- import java.awt.*;
- import java.util.*;
- /* Easy ( 2
- FirstApplet */
- /* Easy C */
- public class FirstApplet extends Applet
- {
- /* Easy ( 3
- paint */
- /* Easy F */
- // This method displays the applet.
- // The Graphics class is how you do all drawing in Java.
- public void paint(Graphics g)
- {
- /* Easy ( 12
- variables declaration */
- int i,j,x,y;
- int m = 1;
- int n = 1;
- double k;
- Color blue = new Color(0, 0, 255);
- Color green = new Color(0, 255, 0);
- Color red = new Color(255, 0, 0);
- int BOLD = 1;
- int ITALIC = 2;
- Font ArialBold = new Font("Arial",BOLD,20);
- Font ArialItalic= new Font ("ARIAL",ITALIC,20);
- /* Easy ) */
- g.setFont(ArialBold);
- do
- {
- j = 0;
- for (i = 1; i < 4; i++)
- {
- x = (int)(Math.random()*200);
- /* Easy - */
- y = (int)(Math.random()*100);
- switch (i)
- {
- case 1:
- g.setColor(red);
- break;
- case 2:
- g.setColor(blue);
- break;
- case 3:
- g.setColor(green);
- break;
- }
- if (m == 2)
- {
- /* Easy ( 14
- write "EasyCODE for JAVA" */
- g.drawString("EasyCODE for JAVA", x, y);
- /* Easy - */
- m=1;
- /* Easy ) */
- }
- else
- {
- g.drawString("EasyCODE from Siemens", x, y);
- if (n == 2)
- {
- /* Easy ( 10
- set Font BOLD */
- g.setFont(ArialBold);
- /* Easy - */
- n=1;
- /* Easy ) */
- }
- else
- {
- /* Easy ( 11
- set Font ITALIC */
- g.setFont(ArialItalic);
- /* Easy - */
- n=2;
- /* Easy ) */
- }
- m=2;
- }
- /* Easy ( 9
- waiting loop */
- for (k=1; k<100000; k++)
- {
- //do nothing
- }
- /* Easy ) */
- if (i==2 || i==3)
- {
- g.clearRect(0, 0, 1000, 1000);
- }
- }
- g.clearRect(0, 0, 1000, 1000);
- }
- while (true);
- }
- /* Easy ) */
- }
- /* Easy E */
- /* Easy ) */
- /* Easy ) */
-